package com.ming.elm.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.ming.elm.service.BusinessService;
import com.ming.elm.service.impl.BusinessServiceImpl;
import com.ming.elm.po.Business;

public class BusinessController {

	private BusinessService bs = new BusinessServiceImpl();

	// 根据分类Id查询商家信息
	public Object listBusinessByOrderTypeId(HttpServletRequest request) throws Exception{
		String str = request.getParameter("orderTypeId");
		Integer orderTypeId = Integer.valueOf(str);
		List<Business> list = bs.listBusinessByOrderTypeId(orderTypeId);

		return list;
	}

	// 根据商家Id查询商家信息
	public Object getBusinessById(HttpServletRequest request) throws Exception{
		String str = request.getParameter("businessId");
		Integer businessId = Integer.valueOf(str);
		Business business = bs.getBusinessById(businessId);

		return business;
	}
}
